<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>套餐数据维护</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/aa.js"></script>
<link rel="stylesheet" href="front/css/common.css" type="text/css" />

</head>
<body>
<html:form action="maintainVehicleAction" method="post">
<input type="hidden" name="callMethod" id="callMethod" value="getVehicleTypeList"/>
<aa:zone name="areaZone">
	<div id="man_zone">
	
				<table width="99%" border="0" align="center" cellpadding="3"  id="tctable"
					cellspacing="1" class="table_style">
		<tr>
			<td width="3%" class="left_title_3">序号</td>
			<td width="10%" class="left_title_3">套餐名称</td>
			<td width="8%" class="left_title_3">手续费</td>
			<td width="8%" class="left_title_3">抵押公正费</td>
			<td width="9%" class="left_title_3">担保费</td>
			<td width="11%" class="left_title_3">车队服务费</td>
			<td width="11%" class="left_title_3">GPS费</td>
			<td width="10%" class="left_title_3">监管费</td>
			<td width="10%" class="left_title_3">保证金费</td>
			<td width="8%" class="left_title_3">预收费</td>
			<td class="left_title_3">操作</td>
		</tr>
		<nested:iterate name="tcList" id="tc" scope="request" indexId="tcid">
		<tr>			
			<td  ><%=tcid+1 %></td>		
			<td><nested:write name="tc" property="tcname"/></td>
			
			<td ><nested:write name="tc" property="sxf"/><nested:notEqual name="tc" value="1" property="sxfl">%</nested:notEqual></td>
			<td ><nested:write name="tc" property="dygzfd"/><nested:notEqual name="tc" value="1" property="dygzfl">%</nested:notEqual><br>
				<%--小车：<nested:write name="tc" property="dygzfx"/><nested:notEqual name="tc" value="1" property="dygzfl">%</nested:notEqual> --%>
			</td>
			<td ><nested:write name="tc" property="dbf"/><nested:notEqual name="tc" value="1" property="dbfl">%</nested:notEqual></td>
			<td >一年：<nested:write name="tc" property="cdfwf1"/><br/>二年：<nested:write name="tc" property="cdfwf2"/><br/>三年：<nested:write name="tc" property="cdfwf3"/><br/></td>
			<td >一年：<nested:write name="tc" property="gpsf1"/><br/>二年：<nested:write name="tc" property="gpsf2"/><br/>三年：<nested:write name="tc" property="gpsf3"/><br/></td>
			<td ><nested:write name="tc" property="jgfd"/><nested:notEqual name="tc" value="1" property="jgfl">%</nested:notEqual><%-- <br>小车：<nested:write name="tc" property="jgfx"/><nested:notEqual name="tc" value="1" property="jgfl">%</nested:notEqual>--%></td>
			<td ><nested:write name="tc" property="bzj"/><nested:notEqual name="tc" value="1" property="bzjl">%</nested:notEqual></td>
			<td ><nested:write name="tc" property="ys"/><nested:notEqual name="tc" value="1" property="ysl">%</nested:notEqual></td>
			<td ><input type="button" id="box_btn1" onclick="fuzhi('<nested:write name="tc" property="id"/>','<nested:write name="tc" property="tcname"/>','<nested:write name="tc" property="sxf"/>','<nested:write name="tc" property="dygzfd"/>','<nested:write name="tc" property="dygzfx"/>','<nested:write name="tc" property="dbf"/>','<nested:write name="tc" property="cdfwf1"/>','<nested:write name="tc" property="jgfd"/>','<nested:write name="tc" property="bzj"/>','<nested:write name="tc" property="ys"/>','<nested:write name="tc" property="jgfx"/>','<nested:write name="tc" property="cdfwf2"/>','<nested:write name="tc" property="cdfwf3"/>','<nested:write name="tc" property="sxfl"/>','<nested:write name="tc" property="dygzfl"/>','<nested:write name="tc" property="dbfl"/>','<nested:write name="tc" property="jgfl"/>','<nested:write name="tc" property="bzjl"/>','<nested:write name="tc" property="ysl"/>','<nested:write name="tc" property="gpsf1"/>','<nested:write name="tc" property="gpsf2"/>','<nested:write name="tc" property="gpsf3"/>');" value="编辑"><br>
				 <nested:notEqual value="0" property="tccount" name="tc">
				 	<input type="button"  disabled="disabled" value="删除">
				 </nested:notEqual>
				 
				 <nested:equal value="0" property="tccount" name="tc">
				 	<input type="button" onclick="sc('<nested:write name="tc" property="id"/>')" value="删除">
				 </nested:equal>
			 </td>			
			
		</tr>
		</nested:iterate>	
		</table>
			
<br>
	
 			<table width="99%" border="0" align="center" cellpadding="3"	cellspacing="1" class="table_style">
			<tr>
			<td width="3%" class="left_title_3">&nbsp;</td>
			<td width="10%" class="left_title_3">套餐名称</td>
			<td width="8%" class="left_title_3">手续费</td>
			<td width="8%" class="left_title_3">抵押公正费</td>
			<td width="9%" class="left_title_3">担保费</td>
			<td width="11%" class="left_title_3">车队服务费</td>
			<td width="11%" class="left_title_3">GPS费</td>
			<td width="10%" class="left_title_3">监管费</td>
			<td width="10%" class="left_title_3">保证金费</td>
			<td width="8%" class="left_title_3">预收费</td>
			<td class="left_title_3">操作</td>
			</tr>
			<tr>	
			<td></td>		
				<td ><input type="hidden" name="tcid"  id="tcid"><input maxlength="15"  type="text" style="width:90%;" name="tcname" id="tcname"></td>
				<td ><input type="text" maxlength="6"  style="width:95%;" class="tcdata" id="sxf" name="sxf"><br><label><input type="radio" name="sxfl" value="1.0" checked="checked" />数值</label><br><label><input type="radio" name="sxfl" value="0.01"/>比率</label></td>
				<td ><input type="text" maxlength="6" style="width:95%;" class="tcdata" id="dygzfd" name="dygzfd"><%--<br>小车：-- --%><input type="hidden" value="0" id="dygzfx" name="dygzfx"><br><label><input type="radio" name="dygzfl" value="1.0"checked="checked" />数值</label><br><label><input type="radio" name="dygzfl" value="0.01"/>比率</label></td>
				<td ><input type="text" maxlength="6" style="width:95%;" class="tcdata" id="dbf" name="dbf"><br><label><input type="radio" name="dbfl" value="1.0"checked="checked" />数值</label><br><label><input type="radio" name="dbfl" value="0.01"/>比率</label></td>
				<td >一年：<input type="text" maxlength="6" style="width:35px;" class="tcdata" maxlength="6" id="cdfwf1" name="cdfwf1" ><br>二年：<input maxlength="6" type="text" style="width:35px;" class="tcdata" id="cdfwf2" name="cdfwf2"><br>三年：<input type="text" style="width:35px;" class="tcdata" id="cdfwf3" name="cdfwf3"></td>
				<td >一年：<input type="text" maxlength="6" style="width:35px;" class="tcdata" maxlength="6" id="gpsf1" name="gpsf1" ><br>二年：<input maxlength="6" type="text" style="width:35px;" class="tcdata" id="gpsf2" name="gpsf2"><br>三年：<input type="text" style="width:35px;" class="tcdata" id="gpsf3" name="gpsf3"></td>
				<td ><input type="text" maxlength="6" style="width:95%;" class="tcdata" id="jgfd" name="jgfd"><%--<br>小车： --%><input type="hidden" value="0" id="jgfx" name="jgfx"><br><label><input type="radio"  name="jgfl" value="1.0"checked="checked" />数值</label><br><label><input type="radio" name="jgfl" value="0.01"/>比率</label></td>
				<td ><input type="text" maxlength="6" style="width:95%;" class="tcdata" id="bzj" name="bzj"><br><label><input type="radio" name="bzjl" value="1.0"checked="checked" />数值</label><br><label><input type="radio" name="bzjl" value="0.01"/>比率</label></td>
				<td ><input type="text" maxlength="6" style="width:95%;" class="tcdata" id="ys" name="ys"><br><label><input type="radio" name="ysl" value="1.0"checked="checked" />数值</label><br><label><input type="radio" name="ysl" value="0.01"/>比率</label></td>
				<td ><input type="button" id="box_btn" value="新增" onclick="updateTC()"> </td>
			</tr>
			</table>
		
</div>
		
	
		</aa:zone>
</html:form>


<script type="text/javascript">
function fuzhi(x1,x3,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20,x21,x22,x23,x24,x25){
    
	
	$('#tcid').val(x1);
	$('#tcname').val(x3);
	
	$('#sxf').val(x5);
	
	$('#dygzfd').val(x6);
	$('#dygzfx').val(x7);
	
	$('#dbf').val(x8);
	$('#cdfwf1').val(x9);
	

	$('#jgfd').val(x10);
	
	
	$('#bzj').val(x11);
	$('#ys').val(x12);
	
	$('#jgfx').val(x13);
	
	$('#cdfwf2').val(x14);
	$('#cdfwf3').val(x15);
	
	$('#gpsf1').val(x23);
	$('#gpsf2').val(x24);
	$('#gpsf3').val(x25);
	
	 $("input[name='sxfl'][value='"+x17+"']").attr("checked",true);
	 
	 $("input[name='dygzfl'][value='"+x18+"']").attr("checked",true);
	 $("input[name='dbfl'][value='"+x19+"']").attr("checked",true);
	 $("input[name='jgfl'][value='"+x20+"']").attr("checked",true);
	 $("input[name='bzjl'][value='"+x21+"']").attr("checked",true);
	 $("input[name='ysl'][value='"+x22+"']").attr("checked",true);
	
	$('#box_btn').val('更新');
}

function updateTC(){
	var i=0;
	
	
	if($.trim($('#tcname').val())==''){
		alert('请输入套餐名称!');
		return;
	}
	
	
	
	
	$(".tcdata").each(function(index){
		if($.trim(this.value)==""||isNaN(this.value)||(this.value<0)){
			i++;
			alert("套餐费率必须输入数字,且为正数!");
			return false;
		}
	});
	if(i>0){
		return;
	}
	ajaxAnywhere.submitAJAX("updateTC", "areaZone");
}

AjaxAnywhere.prototype.onAfterResponseProcessing = function () {
	alert("您的操作成功执行!");
};


function sc(x1){
	
	if(confirm("确定要删除套餐数据？")){
		$('#tcid').val(x1);
		ajaxAnywhere.submitAJAX("deleteTC", "areaZone");
		$('#tcid').val();
	}
}

ajaxAnywhere.showLoadingMessage = function() {
}
</script>


</body>
</html>